# -*- encoding: utf-8 -*-

class Mov (object):

    """ Classe définissant une instruction MOV Ra, Rb. """

    def __init__ (self, ra, rb, mem):
        self.__ra = ra 
        self.__rb = rb
        self.__mem = mem

    def do (self):
        self.__mem.setRegister(
            num = self.__ra,
            newVal = (self.__mem.getRegister(self.__rb))
            )

    def __str__ (self):
        return "mov r{0:d} r{1:d}".format(self.__ra, self.__rb)
    
    def __unicode__ (self):
        return str(self)
